home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <nwconn.h>
- #include <nwbindry.h>
- #include <nwmsg.h>
-
- #define MAX_BINDERY_OBJ_NAME_LEN 48
-
- main()
- {
- int maxStations;
- char message[] = "Hello, universe";
- WORD i;
- int ccode;
- char objectName[MAX_BINDERY_OBJ_NAME_LEN];
- WORD objectType;
-
- maxStations = GetMaximumNumberOfStations();
- for (i=1; i<=maxStations; i++) {
- ccode = GetConnectionInformation(i, objectName, &objectType, (long *)NULL, (BYTE)NULL);
- if (ccode)
- printf("Unable to get information for connection %u\n", i);
- else if (objectType == OT_USER) {
- printf("Sent hello to %s at connection %d\n", objectName, i);
- SendBroadcastMessage(message, &i, (BYTE *)NULL, 1);
- }
- }
- }